package com.fansl.allround.open.api.feign.fallback;

import com.alibaba.fastjson.JSONObject;
import com.fansl.allround.common.core.constant.enums.EmailMessageTypeEnum;
import com.fansl.allround.open.api.feign.RemoteEmailService;
import com.fansl.allround.open.api.vo.EmailCodeVO;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author fansl
 * @Description: TODO
 * @date 2019/10/10 17:33
 */
@Slf4j
@Component
public class RemoteEmailServiceFallbackImpl implements RemoteEmailService {
    @Setter
    private Throwable cause;

    /**
     * 发送邮件验证码
     *
     * @param receiver
     * @param emailMessageType
     * @return
     */
    @Override
    public EmailCodeVO sendEmailCode(String receiver, EmailMessageTypeEnum emailMessageType) {
        log.error("feign 发送邮件验证码异常:{}",
                JSONObject.toJSONString(new Object[]{receiver,emailMessageType}), cause);
        return null;
    }
}
